package flc.ast.activity;

import androidx.appcompat.app.AppCompatActivity;

import android.os.Bundle;

import com.stark.camera.kit.height.AltimeterRet;

import flc.ast.BaseAc;
import flc.ast.R;
import flc.ast.databinding.ActivityMeasureResultBinding;

public class MeasureResultActivity extends BaseAc<ActivityMeasureResultBinding> {

    public static AltimeterRet ret = null;

    @Override
    protected int onCreate() {
        return R.layout.activity_measure_result;
    }

    @Override
    protected void initView() {
        mDataBinding.ivMeasureResultBack.setOnClickListener(v -> onBackPressed());
    }

    @Override
    protected void initData() {
        if (ret == null) return;
        mDataBinding.tvMeasureResultText1.setText(String.format("%.2f", ret.angleToTop) + "°");
        mDataBinding.tvMeasureResultText2.setText(String.format("%.2f", ret.angleToBottom) + "°");
        mDataBinding.tvMeasureResultText3.setText(String.format("%.2f", ret.destDistance / 100) + "m");
        mDataBinding.tvMeasureResultText4.setText(String.format("%.2f", ret.destHeight / 100) + "m");
    }
}